package com.example.lib5.company_interface.group;

import java.util.ArrayList;

/**
 * 创建日期：2022/6/10 0010 2:52
 *
 * @author tony.sun
 * 类说明：
 */
public class GroupDemo1 {
    public static void main(String[] args) {

        char[] chs=new char[]{'a','b','c'};
        comb1(chs);
    }
    public static void comb(char[] chs){
        int length = chs.length;
        int value=1<<length;
        for (int i = 0; i < value; i++) {
            int t;
            for (int j = 0; j < length; j++) {
                t=1<<j;
                if ((t&i)!=0) {
                    System.out.print(chs[j]);
                }
            }
            System.out.println();
        }

    }
    public static void comb1(char[] chs){
        int length = chs.length;
        int value=1<<length;//总次数
        for (int i = 0; i < value; i++) {
            int t;
            for (int j = 0; j < length; j++) {
                t=1<<j;
                if ((t&i)!=0){
                    System.out.print(chs[j]);
                }
            }
            System.out.println();
        }
    }
}
